home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / pm-utils / sleep.d / 45iwlist < prev    next >
Encoding:
Text File  |  2009-04-07  |  461 b   |  26 lines

  1. #!/bin/sh
  2. # Kludge to force a rescan of available wireless networks on resume, so that
  3. # stale ESSIDs aren't shown as current.
  4. # To be removed when bug #336055 is resolved in the kernel.
  5.  
  6. . "${PM_FUNCTIONS}"
  7.  
  8. which iwlist || exit $NA
  9.  
  10. rescan_wireless()
  11. {
  12.     for iface in /sys/class/net/*; do
  13.         [ -d "$iface/wireless" ] || continue
  14.         iface="${iface##*/}"
  15.         iwlist "$iface" scanning
  16.     done
  17. }
  18.  
  19. case "$1" in
  20.     thaw|resume)
  21.         rescan_wireless
  22.         ;;
  23.     *) exit $NA
  24.         ;;
  25. esac
  26.